home *** CD-ROM | disk | FTP | other *** search
/ TPUG - Toronto PET Users Group / TPUG Users Group CD / TPUG Users Group CD.iso / AMIGA / AMICUS / AMICUS24.ADF / VirusCheck / MoreVirus.DOC next >
Text File  |  1988-04-16  |  7KB  |  147 lines

  1.  
  2. Message-ID: #6719.pnet02.amiga/usenet 7122 chars. (18 more)
  3. From: bill@cbmvax.UUCP (Bill Koester CATS)
  4. Newsgroups: comp.sys.amiga
  5. Subject: Amiga VIRUS
  6. Date: 13 Nov 87 19:32:05 GMT
  7. Reply-To: bill@cbmvax.UUCP (Bill Koester CATS)
  8. Organization: Commodore Technology, West Chester, PA
  9.  
  10.  
  11.                    THE AMIGA VIRUS - Bill Koester (CATS)
  12.  
  13. When I first got a copy of the Amiga VIRUS I was interested to see
  14. how such a program worked. I dissassembled the code to a disk file and
  15. hand commented it. This article will try to pass on some of the things
  16. I have learned through my efforts.
  17.  
  18.  
  19.                   1) Definition.
  20.                   2) Dangers.
  21.                   3) Mechanics
  22.                   4) Prevention
  23.  
  24.  
  25. 1. - Definition.
  26. ----------------
  27.  
  28.    The Amiga VIRUS is simply a modification of the boot block of an
  29. existing DOS boot disk. Any disk that can be used to boot the Amiga (ie
  30. workbench) has a reserved area called the boot block. On an Amiga floppy
  31. the bootblock consists of the first two sectors on the disk. Each sector is
  32. 512 bytes long so the boot block contains 1024 bytes. When KickStart is
  33. bringing up the system the disk in drive 0 is checked to see if it is a
  34. valid DOS boot disk.  If it is, the first two sectors on the disk are
  35. loaded into memory and executed. The boot block normally contains a small
  36. bit of code that loads and initializes the DOS. If not for this BOOT CODE
  37. you would never see the initial CLI. The normal BOOT CODE is very small and
  38. does nothing but call the DOS initialization. Therefore, on a normal DOS
  39. boot disk there is plenty of room left unused in the BOOT BLOCK.
  40.  
  41.    The VIRUS is a replacement for the normal DOS BOOT CODE. In addition to
  42. performing the normal DOS startup the VIRUS contains code for displaying
  43. the VIRUS message and infecting other disks. Once the machine is booted
  44. from an infected disk the VIRUS remains in memory even after a warm start.
  45. Once the VIRUS is memory resident the warm start routine is affected,
  46. instead of going through the normal startup the VIRUS checks the boot disk
  47. in drive 0 for itself. If the VIRUS in memory sees that the boot block is
  48. not infected it copies itself into the boot block overwriting any code that
  49. was there before. It is in this manner that the VIRUS propagates from one
  50. disk to another. After a certain number of disks have been infected the
  51. VIRUS will print a message telling you that Something wonderful has
  52. happened.
  53.  
  54.  
  55. 2. - Dangers.
  56. -------------
  57.  
  58.    When the VIRUS infects a disk the existing boot block is overwritten.
  59. Since some commercial software packages and especially games store special
  60. information in the boot block the VIRUS could damage these disks. When the
  61. boot block is written with the VIRUS, any special information is lost
  62. forever. If it was your only copy of the game then you are out of luck and
  63. probably quite angry!!
  64.  
  65. 3. - Mechanics.
  66. ---------------
  67.  
  68.    Here is a more detailed description of what the virus does. This is
  69. intended to be used for learning and understanding ONLY!! It is not the
  70. authors intention that this description be used to create any new strains
  71. of the VIRUS. What may have once been an innocent hack has turned into a
  72. destructive pain in the #$@ for many people. Lets not make it any worse!!
  73.  
  74.    a.)   Infiltration.
  75.  
  76.             This is the first stage of viral infection. The machine is
  77.      brought up normally by reading the boot block into memory. When
  78.      control is transferred to the boot block code, the virus code
  79.      immediately copies the entire boot block to $7EC00, it then JSR's
  80.      to the copied code to wedge into the CoolCapture vector. Once
  81.      wedged in, control returns to the loaded boot block which performs
  82.      the normal dos initialization. Control is then returned to the
  83.      system.
  84.      
  85.    b.)   Hiding Out.
  86.  
  87.             At this point the system CoolCapture vector has been replaced
  88.      and points to code within the virus. When control is routed
  89.      through the CoolCapture vector the virus first checks for the left
  90.      mouse button, if it is down the virus clears the CoolCapture wedge
  91.      and returns to the system. If the left mouse button is not
  92.      pressed the virus replaces the DoIO code with its own version of
  93.      DoIO and returns to the system.
  94.      
  95.    c.)   Spreading.
  96.  
  97.             The code so far has been concerned only with making sure that
  98.      at any given time the DoIO vector points to virus code. This is
  99.      where the real action takes place. On every call to DoIO the virus
  100.      checks the io_Length field of the IOB if this length is equal to
  101.      1024 bytes then it could possibly be a request to read the boot
  102.      block. If the io_Data field and A4 point to the same address then
  103.      we know we are in the strap code and this is a boot block read
  104.      request. If this is not a boot block read the normal DoIO vector
  105.      is executed as if the virus was not installed. If we are reading
  106.      the boot block we JSR to the old DoIO code to read the boot block
  107.      and then control returns to us. After reading, the checksum for
  108.      the virus boot block is compared to the checksum for the block
  109.      just read in. If they are equal this disk is already infected so
  110.      just return. If they are not equal a counter is incremented and
  111.      the copy of the virus at $7EC00 is written to the boot block on
  112.      the disk. If the counter ANDed with $F is equal to 0 then a
  113.      rastport and bitmap are constructed and the message is displayed.
  114.      
  115.    d.)   Ha Ha.
  116.  
  117.             < Something wonderful has happened >
  118.             < Your AMIGA is alive!!! >
  119.             < and even better >
  120.             < Some of your disks are infected by a VIRUS >
  121.             < Another masterpiece of the Mega-Mighty SCA >
  122.  
  123. 4. - Prevention.
  124. ----------------
  125.  
  126.    How do you protect yourself from the virus?
  127.  
  128.       1) Never warm start the machine, always power down first.
  129.          (works but not to practical!)
  130.  
  131.       2) Always hold down the left mouse button when rebooting.
  132.          (Also works, but only because the VIRUS code checks for
  133.           this special case. Future VIRUS's may not!)
  134.  
  135.       3) Obtain a copy of VCheck1.1 and check all disks before use.  If any
  136.      new virus's appear this program will be updated and released into
  137.      the public domain. VCheck1.1 was posted to usnet and will also be
  138.      posted to BIX.  ( Just like the real thing the best course of
  139.      action is education and prevention!)
  140.      
  141. -- 
  142. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  143. Bill Koester -- CBM  >>Amiga Technical Support<<
  144.                      UUCP  ...{allegra|burdvax|rutgers|ihnp4}!cbmvax!bill 
  145.                      PHONE  (215) 431-9355
  146.  
  147.